#ifndef __ELEC_METER_H__
#define __ELEC_METER_H__

#include "typedef.h"

enum EM_TYPE{
	EM_TYPE_VOL = 0u,
	EM_TYPE_CURRT,
	EM_TYPE_KWH,
};

struct EmeterInitPara{
    uint8_t num; //电表个数
    uint8_t mode; //电表模式
    uint32_t baud; //电表波特率
    char_t left_id[13]; //左枪电表id, 单枪时可以不填
    char_t right_id[13]; //右枪电表id, 单枪时可以不填
};

int32_t emeter_init(struct EmeterInitPara *para);
uint32_t emeter_getvalue(uint8_t id, enum EM_TYPE type);
int32_t emeter_isalarm(uint8_t id);

#endif
